package com.chixing.day05_oop.word;

/**
 * 订单
 */
public class Order implements Cloneable {
    private String name;
    private Product product;
    private int num;

    public Order() {
    }

    public Order(String name, Product product, int num) {
        this.name = name;
        this.product = product;
        this.num = num;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public String toString() {
        return "Name: " + name + " {" + product.toString() + "} Num: " + num;
    }
}
